Peek strike-through setting (gdk_draw_layout_line_with_colors): Render
authorERDI Gergo <cactus@cactus.rulez.org>
Fri, 11 May 2001 23:29:37 +0000 (23:29 +0000)
committerÉRDI Gergo <cactus@src.gnome.org>
Fri, 11 May 2001 23:29:37 +0000 (23:29 +0000)
2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>

* gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
strike-through setting
(gdk_draw_layout_line_with_colors): Render strike-through

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkpango.c

index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 416f08709c8dfd548e5ce50731e0932530731ef6..9d527df0bed1361f129fda2ced924406123e4340 100644 (file)
@@ -171,6 +171,12 @@ Wed May  9 09:08:44 2001  Jonathan Blandford  <jrb@webwynk.net>
 
        * test/makefile.msc (new file) : build the test apps here
 
+2001-05-05  ERDI Gergo  <cactus@cactus.rulez.org>
+
+       * gdk/gdkpango.c (gdk_pango_get_item_properties): Peek
+       strike-through setting
+       (gdk_draw_layout_line_with_colors): Render strike-through
+
 Sat May  5 10:06:24 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Release 1.3.5
index 7146880c78765cc3395593a97e7255d046729130..2ccb2c24a4f3eeaa1dd581aa3ae7a20dc21e2b14 100644 (file)
@@ -37,6 +37,7 @@ static PangoAttrType gdk_pango_attr_embossed_type;
 
 static void gdk_pango_get_item_properties (PangoItem      *item,
                                           PangoUnderline *uline,
+                                          gboolean       *strikethrough,
                                            gint           *rise,
                                           PangoColor     *fg_color,
                                           gboolean       *fg_set,
@@ -193,13 +194,14 @@ gdk_draw_layout_line_with_colors (GdkDrawable      *drawable,
       PangoUnderline uline = PANGO_UNDERLINE_NONE;
       PangoLayoutRun *run = tmp_list->data;
       PangoColor fg_color, bg_color;
-      gboolean fg_set, bg_set, shape_set;
+      gboolean strike, fg_set, bg_set, shape_set;
       GdkGC *fg_gc;
       gint risen_y;
       
       tmp_list = tmp_list->next;
       
       gdk_pango_get_item_properties (run->item, &uline,
+                                    &strike,
                                      &rise,
                                      &fg_color, &fg_set,
                                      &bg_color, &bg_set,
@@ -314,6 +316,17 @@ gdk_draw_layout_line_with_colors (GdkDrawable      *drawable,
                          risen_y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 1);
          break;
        }
+
+      if (strike)
+      {
+         int centerline = logical_rect.y + logical_rect.height / 2;
+         
+         gdk_draw_line (drawable, fg_gc,
+                        x + (x_off + logical_rect.x) / PANGO_SCALE - 1,
+                        risen_y + centerline / PANGO_SCALE,
+                        x + (x_off + logical_rect.x + logical_rect.width) / PANGO_SCALE + 1,
+                        risen_y + centerline / PANGO_SCALE);
+      }
       
       if (fg_gc != gc)
        gdk_pango_free_gc (context, fg_gc);
@@ -427,6 +440,7 @@ gdk_draw_layout (GdkDrawable     *drawable,
 static void
 gdk_pango_get_item_properties (PangoItem      *item,
                               PangoUnderline *uline,
+                              gboolean       *strikethrough,
                                gint           *rise,
                               PangoColor     *fg_color,
                               gboolean       *fg_set,
@@ -440,6 +454,9 @@ gdk_pango_get_item_properties (PangoItem      *item,
 {
   GSList *tmp_list = item->extra_attrs;
 
+  if (strikethrough)
+      *strikethrough = FALSE;
+  
   if (fg_set)
     *fg_set = FALSE;
   
@@ -468,7 +485,12 @@ gdk_pango_get_item_properties (PangoItem      *item,
          if (uline)
            *uline = ((PangoAttrInt *)attr)->value;
          break;
-         
+
+       case PANGO_ATTR_STRIKETHROUGH:
+           if (strikethrough)
+               *strikethrough = ((PangoAttrInt *)attr)->value;
+           break;
+           
        case PANGO_ATTR_FOREGROUND:
          if (fg_color)
            *fg_color = ((PangoAttrColor *)attr)->color;